/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package quizzie;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;

/**
 *
 * @author David
 */
public class Quizzie {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        FileReader fileReader = null;
        try {
            //Declaramos el Archivo
            //Buscamos el Fichero que queremos mostrar
            File newTextFile = new File("./Prueba4.txt");
            fileReader = new FileReader(newTextFile);

            BufferedReader bufferedReader = new BufferedReader(fileReader);
            String line = null;
            Scanner sc = new Scanner(System.in);
            while (sc.nextLine().isEmpty()) {
                int i = 1;
                //Hacemos un Do..While para que no salga hasta que vea el primer hueco vacío
                do {
                    line = bufferedReader.readLine();
                    System.out.println(line);
                    i++;
                } while (line != null && i <= 5);
            }
            //Cerramos la lectura
            bufferedReader.close();
            fileReader.close();
        } catch (IOException ex) {
            System.err.println("IOEx: " + ex.getMessage().toString());
        } finally {
            try {
                fileReader.close();
            } catch (IOException ex) {
                System.err.println("IOEx: " + ex.getMessage().toString());
            }
        }
    }
}
